<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">a
<xsl:text disable-output-escaping="yes">&lt;</xsl:text>%@ Page language="c#" Codebehind="<xsl:value-of select="Schema/@TableName" />List.aspx.cs" AutoEventWireup="false" Inherits="<xsl:value-of select="Schema/@NameSpace" />.<xsl:value-of select="Schema/@TableName" />List" %<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
<HTML>
	<HEAD>
		<title><xsl:value-of select="Schema/@TableName" />List</title>
		<meta content="ESpace.DALTool" name="GENERATOR" />
		<style>
			body
			{
				font-size: 9pt;
				color: #000000;
				font-family: 宋体;
				margin-bottom:0px;
				margin-left:0px;
				margin-top:0px;
				margin-right:0px;
			}
			td
			{
				font-size: 9pt;
				color: #000000;
				font-family: 宋体;
			}
			a:link {
				font-size: 12px;
				color: #CC6600;
				text-decoration: none;
			}
			a:visited {
				font-size: 12px;
				color: #996699;
				text-decoration: none;
			}
			a:hover {
				font-size: 12px;
				color: #cc0000;
				text-decoration: none;
			}
			a:active {
				font-size: 12px;
				color: #CC6600;
				text-decoration: none;
			}
		</style>
	</HEAD>
	<body MS_POSITIONING="FlowLayout">
		<form id="Form1" method="post" runat="server">
			查询结果：<BR />
			共
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Label id="lblRecordCount" runat="server" ForeColor="Red" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>条记录，分
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Label id="lblPageCount" runat="server" ForeColor="Red" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>页显示，每页显示
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:textbox id="txtPageSize" runat="server" Width="32px" BorderStyle="Groove"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>20<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:textbox<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:RangeValidator id="RangeValidator1" runat="server" ErrorMessage="非法的每页显示数量" Type="Integer" MinimumValue="0"
				MaximumValue="100000000" Display="None" ControlToValidate="txtPageSize"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>*<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:RangeValidator<xsl:text disable-output-escaping="yes">&gt;</xsl:text>条，当前为
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:textbox id="txtCurrentPage" runat="server" Width="32px" BorderStyle="Groove"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>1<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:textbox<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:RangeValidator id="RangeValidator2" runat="server" ErrorMessage="非法的页码" Type="Integer" MinimumValue="0"
				MaximumValue="100000000" Display="None" ControlToValidate="txtCurrentPage"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>*<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:RangeValidator<xsl:text disable-output-escaping="yes">&gt;</xsl:text>页
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:button id="btnGo" runat="server" Text="Go..." /<xsl:text disable-output-escaping="yes">&gt;</xsl:text><INPUT type="button" value="新增" onclick="OpenAdd()" />
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:ValidationSummary id="pageValidation" runat="server" ShowSummary="False" ShowMessageBox="True" EnableViewState="False" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:datagrid id="dgResult" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False"
				BackColor="White" BorderColor="#999999" BorderWidth="1px" CellPadding="5"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
				<SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
				<ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
				<HeaderStyle Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" BackColor="#DDDDDD"></HeaderStyle>
				<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
				<Columns><xsl:for-each select="Schema/Columns[IS_PK='1']">
					<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:TemplateColumn SortExpression="<xsl:value-of select="COLUMN_NAME" />" HeaderText="<xsl:value-of select="COLUMN_NAME" />"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
						<ItemTemplate>
							<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:Label id="lab<xsl:value-of select="COLUMN_NAME" />" runat="server" Text='<xsl:text disable-output-escaping="yes">&lt;</xsl:text>%# DataBinder.Eval(Container.DataItem,"<xsl:value-of select="COLUMN_NAME" />")%<xsl:text disable-output-escaping="yes">&gt;</xsl:text>' /<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
						</ItemTemplate>
					<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:TemplateColumn<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
				</xsl:for-each><xsl:for-each select="Schema/Columns[IS_PK='0']">
					<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:BoundColumn DataField="<xsl:value-of select="COLUMN_NAME" />" SortExpression="<xsl:value-of select="COLUMN_NAME" />" HeaderText="<xsl:value-of select="COLUMN_NAME" />" /<xsl:text disable-output-escaping="yes">&gt;</xsl:text></xsl:for-each>
					<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:TemplateColumn<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
						<ItemTemplate>
							<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:HyperLink id="btnEdit" runat="server" NavigateUrl='<xsl:text disable-output-escaping="yes">&lt;</xsl:text>%# "javascript:OpenEdit(<xsl:for-each select="Schema/Columns[IS_PK='1']">\"" + DataBinder.Eval(Container.DataItem,"<xsl:value-of select="COLUMN_NAME" />") + "\"<xsl:if test="position()!=last()">,</xsl:if></xsl:for-each>);"%<xsl:text disable-output-escaping="yes">&gt;</xsl:text>'<xsl:text disable-output-escaping="yes">&gt;</xsl:text>编辑<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:HyperLink<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
						</ItemTemplate>
					<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:TemplateColumn<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
					<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:TemplateColumn<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
						<ItemTemplate>
							<xsl:text disable-output-escaping="yes">&lt;</xsl:text>asp:LinkButton id="btnDelete" runat="server" CommandName="Delete"<xsl:text disable-output-escaping="yes">&gt;</xsl:text>删除<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:LinkButton<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
						</ItemTemplate>
					<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:TemplateColumn<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
				</Columns>
				<PagerStyle VerticalAlign="Middle" NextPageText="下一页" PrevPageText="上一页" HorizontalAlign="Center"
					BackColor="#EEEEEE"></PagerStyle>
			<xsl:text disable-output-escaping="yes">&lt;</xsl:text>/asp:datagrid<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
		</form>
		<script language="javascript">
			function OpenAdd(){
				window.open("<xsl:value-of select="Schema/@TableName" />Edit.aspx?action=add");
			}
			function OpenEdit(<xsl:for-each select="Schema/Columns[IS_PK='1']"><xsl:value-of select="COLUMN_NAME" /><xsl:if test="position()!=last()">,</xsl:if></xsl:for-each>){
				window.open("<xsl:value-of select="Schema/@TableName" />Edit.aspx?action=edit"<xsl:for-each select="Schema/Columns[IS_PK='1']"> + "<xsl:text disable-output-escaping="yes">&amp;</xsl:text><xsl:value-of select="COLUMN_NAME" />=" + <xsl:value-of select="COLUMN_NAME" /></xsl:for-each>);
			}
		</script>
	</body>
</HTML>
</xsl:template>
</xsl:stylesheet>